<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>CSS隐藏元素总结</title>
    <style>
        div {
            width: 100px;
            height: 100px;
            background: red;
            margin: 15px;
            padding: 10px;
            border: 5px solid green;
            display: inline-block;
            overflow: hidden;
        }

        .none {
            /*display: none;*/
        }

        .hidden {
            /*visibility: hidden;*/
        }

        .opacity0 {
            /*opacity: 0;*/
        }

        .height0 {
            /*box-sizing: border-box;*/
            /*height: 0;*/
            /*padding: 0;*/
            /*border: 0;*/
        }
    </style>
</head>
<body>
    <div class="none">none</div>
    <div class="hidden">hidden</div>
    <div class="opacity0">opacity</div>
    <div class="height0">height</div>
    <script src="../public/js/jquery.min.js"></script>
    <script>
        var divs = document.getElementsByTagName('div');
        for(var i = 0; i < divs.length; i++){
            divs[i].onclick = function(){
                console.log(this.firstChild.nodeValue + ' is click')
            }
            $(divs[i]).click();
        }
//        $(".none").on("click", function () {
//            console.log("none clicked");
//        })
//        $(".hidden").on("click", function () {
//            console.log("hidden clicked");
//        })
//        $(".opacity0").on("click", function () {
//            console.log("opacity0 clicked");
//        })
//        $(".height0").on("click", function () {
//            console.log("height0 clicked");
//        })
    </script>
</body>
</html>